﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Menu.Master" AutoEventWireup="true" CodeBehind="frmSilabo.aspx.cs" Inherits="GestionCurriculos.frmSilabo" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script>
    function ConfirmDelete(codSilabo) {
        if (codSilabo == 0) {
            alert('No existen Sílabos a eliminar.');
        } else {
            if (confirm("Esta seguro de eliminar el sílabo seleccionado")) {
                document.getElementById("ContentPlaceHolder1_hidCodSilabo").value = codSilabo;
                document.getElementById("ContentPlaceHolder1_btnEliminarTrue").click();
            } else {
                document.getElementById("ContentPlaceHolder1_hidCodSilabo").value = 0;
            }
        }
    }
    function CheckOne(obj) {
        var grid = obj.parentNode.parentNode.parentNode;
        var inputs = grid.getElementsByTagName("input");
        var row = obj.parentNode.parentNode;

        for (var i = 0; i < inputs.length; i++) {
            if (inputs[i].type == "checkbox") {
                if (obj.checked && inputs[i] != obj && inputs[i].checked) {
                    inputs[i].checked = false;

                    var gvDrv = document.getElementById("<%=gvSilabos.ClientID %>");
                    for (i = 1; i < gvDrv.rows.length; i++) {
                        gvDrv.rows[i].style.border = "initial";
                    }
                }
            }
        }

        if (obj.checked) {
            row.style.border = "solid";
        }
        else {
            row.style.border = "initial";
        }
    }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div style="margin:5px; font-family:Rambla">
    <asp:HiddenField runat="server" ID="hidCodSilabo"/>
    <div style="text-align:center">
        <h1> Lista de Silabos </h1>
    </div>

    <!-- BOTONERA -->
    <div style="width:90%; height:25px; background-color:#064066;"  >
        &nbsp;&nbsp;
        <asp:Button runat="server" ID="btnCrear" Text="Crear" 
            onclick="btnCrear_Click" />
        <asp:Button runat="server" ID="btnModificar" Text="Modificar" 
           onclick="btnModificar_Click" />
        <asp:Button runat="server" ID="btnEliminar" Text="Eliminar" 
           onclick="btnEliminar_Click" />
        <asp:Button runat="server" ID="btnEliminarTrue" Text="Eliminar" style="display:none"
            onclick="btnEliminarTrue_Click" />
    </div>
    <!-- GRILLA -->
    <div>
        <div>
            <table>
                <tr>
                    <td>Nombre del Curso</td>
                    <td>:</td>
                    <td><asp:TextBox runat="server" ID="txtCurso"  Width="180"></asp:TextBox></td>
                    <td>&nbsp;&nbsp;</td>
                    <td><asp:Button runat="server" ID="btnConsultar" Text="Consultar" onclick="btnConsultar_Click" 
                            /></td>  <%--onclick="btnConsultar_Click"--%>
                </tr>
            </table>
        </div>
        <div style="margin-top:5px">
            <asp:GridView runat="server" ID="gvSilabos" AutoGenerateColumns="False" 
                CellPadding="4" ForeColor="#333333" GridLines="Vertical" Width="85%"  
               ><%-- OnRowDataBound="gvCursos_RowDataBound" --%>
                <AlternatingRowStyle BackColor="White" />
                <Columns>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:CheckBox runat="server" id="chkSilabo"  onclick ="CheckOne(this)"/>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="codSilabo" HeaderText="Código de Sílabo" />
                    <asp:BoundField DataField="nomCurso" HeaderText="Curso Asociado" />
                    <asp:BoundField DataField="peracademico" HeaderText="Período Académico" ItemStyle-HorizontalAlign="Center"     />
                </Columns>
                <EditRowStyle BackColor="#2461BF" />
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#064066" Font-Bold="True" ForeColor="White" BorderColor="Black" BorderStyle="solid" BorderWidth="1px" />
                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#EFF3FB"/>
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#F5F7FB" />
                <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                <SortedDescendingCellStyle BackColor="#E9EBEF" />
                <SortedDescendingHeaderStyle BackColor="#4870BE" />
            </asp:GridView>
        </div>
    </div>
</div>
<!-- <RowStyle BackColor="#EFF3FB"  BorderColor="Black" BorderStyle="solid" BorderWidth="1px"  /> -->
</asp:Content>
